package com.itzxx.huazhun.utils.ble

object BleConstant {
    const val SERVICE_UUID = "FFC0"
    const val WRITE_CHARACTERISTIC_UUID = "FFC1"
    const val NOTIFY_CHARACTERISTIC_UUID = "FFC2"

    const val PROTOCOL_HEADER1: UByte = 0x55u
    const val PROTOCOL_HEADER2: UByte = 0xAAu
    const val PROTOCOL_END1: UByte = 0x0Du
    const val PROTOCOL_END2: UByte = 0x0Au

    const val MAC_BYTE = 8

    const val HOLE_NUM_MAX = 2

    object ProbeFeature {
        const val AIR_PRESSURE = 0//气压传感器index
        const val TEMPERATURE = 1//温度传感器index
    }

    object Ack {
        const val SUCCESS = 0
        const val ERROR = 1
    }

    object Cmd {
        // 获取协调器信息
        const val GET_COORDINATOR_INFO_REQUEST: UByte = 0x01u
        const val GET_COORDINATOR_INFO_RESPONSE: UByte = 0x02u

        // 获取探头信息
        const val GET_PROBE_INFO_REQUEST: UByte = 0xA1u
        const val GET_PROBE_INFO_RESPONSE: UByte = 0xA2u

        // 读取采集信息
        const val READ_SAMPLING_INFO_REQUEST: UByte = 0xA3u
        const val READ_SAMPLING_INFO_RESPONSE: UByte = 0xA4u

        // 读取采集数据
        const val READ_SAMPLING_DATA_REQUEST: UByte = 0xA5u
        const val READ_SAMPLING_DATA_RESPONSE: UByte = 0xA6u

        // 设置探头采集参数
        const val SET_PROBE_PARAMETER_REQUEST: UByte = 0xA7u
        const val SET_PROBE_PARAMETER_RESPONSE: UByte = 0xA8u

        // 清除探头采集数据
        const val CLEAR_PROBE_SAMPLING_DATA_REQUEST: UByte = 0xA9u
        const val CLEAR_PROBE_SAMPLING_DATA_RESPONSE: UByte = 0xAAu

        // 指令校准
        const val AIR_PRESSURE_CALIBRATION_REQUEST: UByte = 0xABu
        const val AIR_PRESSURE_CALIBRATION_RESPONSE: UByte = 0xACu
    }
}